Column

Level of Psychological distress

Diagnosed with anxiety/depression

---
        title: "Statistics"
        output: 
          flexdashboard::flex_dashboard:
            orientation: columns
            social: menu
            source_code: embed
        ---
        
        ```{r setup, include=FALSE}
        # rm(list=ls())
        
        library(flexdashboard)
        library(ggplot2)
        library(plotly)
        library(tidyr)
        library(readxl)
        library(leaflet)
        library(stringr)
        library(DT)
        
        cob_sub_merge <- read.csv("Country of birth of people aged 15-24 by Suburb.csv",stringsAsFactors = F)
        
        #VPHS data
        psy_dist <- read.csv("Level of psychological distress 2015-19.csv",stringsAsFactors = F)
        
        diag_anxdep <- read.csv("Ever diagnosed with anxiety or depression 2015-19.csv",stringsAsFactors = F)
        
        ```
        
        Column {.tabset .tabset-fade}
        -----------------------------------------------------------------------
        
        ### **Level of Psychological distress**
        
        ```{r Level of Psychological distress, echo=FALSE}
        # Level of Psychological distress
        
        psy_dist_graph <- psy_dist %>%
          gather(key,value,-Year) %>%
          mutate(value=as.integer(value))
        
        psy_dist_graph$key <- factor(psy_dist_graph$key,levels=c('Low','Moderate','High','Very_High', 'High_or_Very_High'))
        sizes <- c('Low' = 1, 'Moderate' = 1, 'High' = 1, 'Very_High' = 1, 'High_or_Very_High' = 1)
        
        
        lpd <- ggplot(psy_dist_graph,aes(x=Year,y=value,group=key,color=key))+
          geom_point()+
          labs(title =str_wrap('Changes in the level of psychological distress for Victorian adults over the years'),
            subtitle = str_wrap("The line chart visualizes the proportion (%) of adult population (18+ years), by level of psychological distress changes in Victoria over 2015-2019. The higher level of psychological distress for was the highest in 2019."),
               caption = "•Data obtained from Victorian Population Health Survey",
               x='',
               y='Number of people') +
          geom_line(aes(colour = key, size = key, group = key)) +
          scale_size_manual(values = sizes) +
          scale_color_manual(values = c(rcartocolor::carto_pal(name = "Bold"), "grey50"))+ 
          theme_bw()
        lpd
        ```
        
        ### **Diagnosed with anxiety/depression**
        
        ```{r Diagnosed with anxiety/depression, echo=FALSE}
        
        names(diag_anxdep) <- c("Year","Proportion_of_people")
        
        diag_ad_graph <-ggplot(diag_anxdep,aes(x=Year,y=Proportion_of_people))+
            geom_line(size=1,color="#0174DF")+
          geom_point(size=4,shape=21,fill="white") +
          labs(title =str_wrap('Proportion of adults that were diagnosed with anxiety or depression over time'),
            subtitle = str_wrap("The line chart visualizes the proportion (%) of adult population (18+ years), with anxiety or depression in Victoria over 2015-2019. The proportion of adults has been gradually increasing over the years."),
               caption = "•Data obtained from Victorian Population Health Survey",
            x="",
            y="Proportion of people")+
          theme_bw()
        
        diag_ad_graph
        ```